var fs = require('fs');
var moment = require('moment');

function writLog(msg){
    var date = new Date();
    fs.writeFile('./log/debug.log', moment(date).format("YYYY-MM-DD HH:mm:ss")+' | '+msg+"\n", function (err) {
        if (err) throw err;
        console.log('It\'s saved!');
    });
}

module.exports = writLog;